Analysing Switch-Case Code with Abstract Execution
نویسندگان
چکیده
Constructing the control-flow graph (CFG) of machine code is made difficult by dynamic transfers of control (DTC), where the address of the next instruction is computed at run-time. Switchcase statements make compilers generate a large variety of machine-code forms with DTC. Two analysis approaches are commonly used: pattern-matching methods identify predefined instruction patterns to extract the target addresses, while analytical methods try to compute the set of target addresses using a general value-analysis. We tested the abstract execution method of the SWEET tool as a value analysis for switch-case code. SWEET is here used as a plugin to the Bound-T tool: thus our work can also be seen as an experiment in modular tool design, where a general value-analysis tool is used to aid the CFG construction in a WCET analysis tool. We find that the abstract-execution analysis works at least as well as the switch-case analyses in Bound-T itself, which are mostly based on pattern-matching. However, there are still some weaknesses: the abstract domains available in SWEET are not well suited to representing sets of DTC target addresses, which are small but sparse and irregular. Also, in some cases the abstract-execution analysis fails because the used domain is not relational, that is, does not model arithmetic relationships between the values of different variables. Future work will be directed towards the design of abstract domains eliminating these weaknesses. 1998 ACM Subject Classification F3.2 Semantics of Programming Languages: Program Analysis
منابع مشابه
Analysing Switch-Case Tables by Partial Evaluation
Tracing the flow of control in code generated from switchcase statements is difficult for static program analysis tools when the code contains jumps to dynamically computed target addresses. Analytical methods such as abstract interpretation using integer intervals can work for some forms of switchcase code, for example a jump via a table of addresses indexed 1 .. n, but fail when the target ...
متن کاملIssues in Analysing L4 for its WCET
Real-time analysis of a system requires knowledge of the worst-case execution time of all code in the system. This requirement covers not only application code, but also operating system and kernel code. In this paper we discuss the issues specific to kernel code and how we aim to address these in our work towards analysing the L4 microkernel for the worst-case execution times of all system-cal...
متن کاملChallenges arising from the conciseness of Islamic criminal law in the implementation of alternatives to imprisonment
Due to the relatively emerging issue of alternatives to imprisonment, the Iranian judicial system has always faced various legal challenges, as the case may be, in the process of determining or implementing them. Authors with analytical and library method and with the knowledge of the wide range of legal challenges on the subject in terms of aspect and territory, only to a specific aspect an...
متن کاملAbstract Interpretation of Binary Code with Memory Accesses using Polyhedra
In this paper we propose a novel methodology for static analysis of binary code using abstract interpretation. We use an abstract domain based on polyhedra and two mapping functions that associate polyhedra variables with registers and memory. We demonstrate our methodology to the problem of computing upper bounds to loop iterations in the code. This problem is particularly important in the dom...
متن کاملTiming Analysis of Optimised Code
Timing analysis is a crucial test for dependable hard real-time systems (DHRTS). The calculation of the worst-case execution time (WCET) is mandatory. As modern compilers are capable to produce small and efficient code, software development for DHRTS today is mostly done in high-level languages instead of assembly code. Execution path information available at source code (flow facts) therefore ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2015